package com.xjoyt.pay.master.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xjoyt.pay.controllers.AbstractController;
import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.gateway.params.CallbackParam;
import com.xjoyt.pay.gateway.params.RefundParam;
import com.xjoyt.pay.master.dto.CallbackResult;
import com.xjoyt.pay.master.dto.RefundResult;
import com.xjoyt.pay.master.interfaces.RefundContract;
import com.xjoyt.pay.master.services.RefundService;

@RestController
@RequestMapping("refund")
public class RefundController extends AbstractController implements RefundContract {

	@Autowired
	private RefundService service;

	@Override
	public ExecuteResult<RefundResult> create(@RequestBody RefundParam param) {
		return service.create(param);
	}

	@Override
	public ExecuteResult<CallbackResult> callback(@RequestBody CallbackParam param) throws Exception {
		return service.callback(param);
	}
}
